{% extends "v2ex/_base.html" %}
{% block title %}{{ data.title }}{% endblock %}
{% block rightbar %}{% endblock %}
{% block body %}
<div class="sep20"></div>
<div class="box">
    <div class="header" >
        <a href="#">SJZLUG</a>
        <span class="chevron"><span class="chevron">&nbsp;›&nbsp;</span>登录</span>
    </div>
    <div class="message">登录后你可以使用更多的系统功能</div>
    <div class="inner">
        <form  method="post" id="signinform"  class="form-horizontal" role="form">
            {{data.form.hidden_tag()}}
            <div style="height:10px;"></div>
            <span class="fade" style="color:#f00;">
            {% for message in get_flashed_messages() %}{{ message }}{% endfor %}
            </span>
            <div class="form-group" style="height:34px;">
                <label for="name" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-10">
                    {{ data.form.name(placeholder="用户名",class="form-control",style="width:40%;") }}
                    {% for error in data.form.name.errors %} {{ error }} {% endfor %}
                    <span class="fade">你可以使用注册的用户名,邮箱，手机号，QQ进行登录</span>
                </div>
            </div>
           <div class="form-group">
                <label for="pwd" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    {{ data.form.pwd(placeholder="密码",class="form-control",style="width:40%;") }}
                    {% for error in data.form.pwd.errors %} {{ error }} {% endfor %}
                </div>
            </div>
           <div class="form-group">
                <label class="col-sm-2"></label>
                <div class="col-sm-10">
                    <input type="button" id = "btn_signin" class="super normal button" value="登录">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="sep20"></div>
<script src="/static/v2ex/js/md5.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
        $('#btn_signin').click(function(){
            $("#btn_signin").attr('disabled',true);
            var form= document.getElementById("signinform");
            if (form){
                form.pwd.value = md5(form.pwd.value);
                //form.action="{{ url_for('main.signin') }}";
                form.submit();
            }
            $("#btn_signin").attr('disabled',false);
        });
    });
    </script>
{% endblock %}
